Skip to content

feat: Playwright CDP リモートブラウザ接続 + Google Drive エビデンス保管 Skill 追加 (v4.10.0)#20

Open
takemi-ohama wants to merge 6 commits into
mainfrom
feature/playwright-browser-connect
Open

feat: Playwright CDP リモートブラウザ接続 + Google Drive エビデンス保管 Skill 追加 (v4.10.0)#20
takemi-ohama wants to merge 6 commits into
mainfrom
feature/playwright-browser-connect

Conversation

@takemi-ohama
Copy link
Copy Markdown
Contributor

Summary

Playwright E2E テストエコシステムに 2 つの専門 Skill を追加し、テスト基盤を 7 Skill 体制に拡充する。

  • playwright-browser-connect Skill 新規追加: scenario.config.yamlbrowser: セクションで接続モードを宣言的に切り替え (local / cdp-remote)。WSL2 Docker→Windows Chrome、macOS Docker→Chrome の CDP 接続パターンをネットワーク別セットアップ手順・トラブルシュート付きで網羅。--remote-allow-origins=* による Host ヘッダ検証回避で proxy 不要な構成を実現
  • playwright-evidence-drive Skill 新規追加: テスト後のエビデンス一式 (video/trace/HAR/report.md) を Google Drive に保管。--pwk-drive-folder 自動アップロード、手動スクリプト、report.md→Google Docs 変換 + Drive リンク埋め込みに対応。セキュリティ考慮事項 (trace.zip 内の認証情報) を明記
  • conftest.py.templatebrowser session fixture 追加: browser_type_launch_args を依存に含め --headed / slow_mo / channel を local モードに反映。CDP 接続時の Chromium 以外ブラウザの fail-fast チェック付き。_cdp_default_context fixture で既存ログイン済み Session 再利用に対応
  • config.pyBrowserConfig dataclass 追加: mode (local/cdp-remote) と cdp_endpoint を型安全に管理。HTTP エンドポイント (http://localhost:9222) を既定値とし、Playwright の /json/version 経由 WebSocket 自動解決に準拠
  • scenario.config.yaml テンプレート拡充: browser: セクション追加。環境変数 ${CDP_ENDPOINT} による接続先切り替え例をコメントで提供
  • 関連 6 Skill の参照リンク更新: playwright-execution / kit-ops / report / scenario-test の SKILL.md に新 Skill へのクロスリファレンスを追加
  • plugin.json v4.10.0: Skills 44個→46個、marketplace.json の description を更新

変更ファイル一覧 (12 files, +696 -4)

ファイル 変更内容
plugins/ndf/skills/playwright-browser-connect/SKILL.md 新規: CDP 接続構成 Skill (364行)
plugins/ndf/skills/playwright-evidence-drive/SKILL.md 新規: Drive エビデンス保管 Skill (190行)
plugins/ndf/skills/playwright-kit-ops/templates/conftest.py.template browser fixture + CDP default context fixture 追加
plugins/ndf/skills/playwright-kit-ops/playwright_kit/config.py BrowserConfig dataclass + Config への統合
plugins/ndf/skills/playwright-kit-ops/templates/scenario.config.yaml browser: セクション追加
plugins/ndf/skills/playwright-execution/SKILL.md 関連 Skill リンク追加
plugins/ndf/skills/playwright-kit-ops/SKILL.md 関連 Skill リンク追加
plugins/ndf/skills/playwright-report/SKILL.md Drive 共有セクション + リンク更新
plugins/ndf/skills/playwright-scenario-test/SKILL.md Skill 一覧表に 2 Skill 追加
plugins/ndf/.claude-plugin/plugin.json v4.10.0, skills 配列に 2 エントリ追加
.claude-plugin/marketplace.json description 更新
plugins/ndf/CHANGELOG.md v4.10.0 エントリ追加

Test plan

  • uv run pytest tests/ -x -q 全テストパス (161 passed)
  • claude plugin validate plugins/ndf パス
  • BrowserConfig.from_raw() で local / cdp-remote の両モード正常パース確認
  • conftest.py.template の browser fixture が browser_type_launch_args を正しく参照することを確認
  • CDP endpoint の既定値が http://localhost:9222 (Playwright の connect_over_cdp が期待する HTTP 形式) であることを確認
  • 実環境での CDP 接続テスト (Windows WSL2 / macOS Docker Desktop)
  • Google Drive アップロード E2E テスト

takemi-ohama and others added 5 commits May 26, 2026 02:43
… (v4.10.0)

- playwright-browser-connect: ローカル Chromium / Windows CDP / macOS CDP の 3 パターン対応
- playwright-evidence-drive: テストエビデンス一式の Google Drive 保管・共有
- config.py に BrowserConfig dataclass 追加 (mode: local|cdp-remote)
- scenario.config.yaml に browser: セクション追加
- conftest.py.template に connect_over_cdp() 対応 browser fixture 追加
- 関連 Skill の参照リンクを更新

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- SKILL.md: upload_evidence.py の引数 --parent → --parent-folder-id に修正
- SKILL.md: gdrive_upload_dir.py の引数を --local/--parent に修正
- SKILL.md: build_gdoc_with_drive_links.py の引数を --md/--folder/--run-id/--name に修正
- conftest.py.template: CDP 接続時に slow_mo を渡すよう修正
- conftest.py.template: local モードで pwk_config.playwright.headless を setdefault で尊重
- conftest.py.template: CDP モード既存 Session 再利用用の _cdp_default_context fixture 追加
- playwright-browser-connect/SKILL.md: conftest.py スニペットをテンプレートと同期
- scenario.config.yaml / SKILL.md: CDP URL を ws:// → http:// に統一

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- SKILL.md: TCP proxy を廃止し --remote-allow-origins=* フラグによる
  Host ヘッダ検証回避に差し替え (proxy 不要でシンプル化)
- conftest.py.template: CDP接続/localモード両方で scenario.config.yaml の
  playwright.slow_mo_ms をフォールバックとして反映
- config.py: cdp_endpoint が null (YAML でキーのみ定義) の場合に
  "None" 文字列にならないよう or 演算子でガード

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- SKILL.md: Chrome の 127.0.0.1 バインド問題に対応するネットワーク別接続ガイドを追加
  (--remote-debugging-address=0.0.0.0 / socat / netsh portproxy の3方式 + 早見表)
- config.py: browser.mode が null の場合に ValueError でクラッシュする問題を修正
  (raw.get("mode") or base.mode でデフォルト値へフォールバック)
- marketplace.json: NDF の description を v4.10.0 / 46 skills に更新

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
SKILL.md や他の例示と一致するよう、旧 proxy 前提の 9223 を標準の 9222 に修正。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor Author

@takemi-ohama takemi-ohama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 cross-review | round 6 | codex | REQUEST_CHANGES

CDP リモートブラウザ接続は、通常の page / context 利用時にログイン済み Session を再利用できる経路と、WSL2 Docker から Windows Chrome へ実際に到達する endpoint の案内を修正してください。

Comment thread plugins/ndf/skills/playwright-browser-connect/SKILL.md Outdated
Copy link
Copy Markdown
Contributor Author

@takemi-ohama takemi-ohama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 cross-review | round 6 | gemini | APPROVE

PR #20 の内容を確認しました。Playwright の CDP リモートブラウザ接続対応と Google Drive エビデンスアーカイブ機能の追加により、E2E テストの運用性が大幅に向上しています。コードの品質、ドキュメントの整備状況ともに良好です。将来的な安定性のための軽微な提案を数点行いますが、このままマージ可能です。

Comment thread plugins/ndf/skills/playwright-kit-ops/playwright_kit/config.py
1. [major] conftest.py.template: context/page fixture を cdp-remote 時に
   既存コンテキスト/ページを返すようオーバーライド。標準テストコードが
   CDP のログイン済み Session を自動的に使えるようになった。
2. [major] SKILL.md: Docker (WSL2) の接続先を host-gateway → host.docker.internal
   に修正。WSL2 直接実行時の Windows ホスト IP 取得方法も注記追加。
3. [minor] conftest.py.template: CDP での browser.close() が disconnect であり
   リモートブラウザ自体は終了しない旨のコメントを追加。
4. [minor] config.py: cdp_endpoint が空文字列/空白の場合にデフォルト値へ
   フォールバックするバリデーションを追加し、docstring で挙動を明記。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant